const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
  try {
    const { OPENID } = cloud.getWXContext()
    const result = await cloud.openapi.subscribeMessage.send({
        touser: OPENID,
        page: '/pages/start/start',
        data: {
          name7: {
            value: event.nickName
          },
          number4: {
            value: event.number4
          },
          number3: {
            value: event.number3
          },
          date2: {
            value: event.date2
          },
          thing1: {
            value: event.thing1
          }
        },
        templateId: 'z-jWpzEeO6sDNdysI7pzWW_PdMLg_rrxK3muHI'
      })
    console.log(result)
    return result
  } catch (err) {
    console.log(err)
    return err
  }
}